<template>
  <el-dialog
    v-bind="$attrs"
    class="ex-dialog"
    :title="title"
    :visible="visible"
    :before-close="_handleBeforeClose"
    :close-on-click-modal="isclose"
  >
    <div class="ex--dialog--main">
      <slot />
    </div>
    <div class="ex--dialog--footer">
      <slot name="footer" />
    </div>
  </el-dialog>
</template>
<script>
export default {
  props: {
    title: String,
    visible: Boolean,
    isclose: {
      type: Boolean,
      default: true
    }
  },
  created(){
    console.log('++isclose', this.isclose)
  },
  data() {
    return {}
  },
  methods: {
    _handleBeforeClose() {
      this.$emit('closeDialog')
    }
  }
}
</script>
<style lang="scss" scoped>
.ex-dialog {
  ::v-deep .el-dialog__body {
    padding: 0;
  }
}

.ex--dialog--main {
  padding: 20px;
}
.ex--dialog--footer {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid $borderColor;
  ::v-deep .el-button {
    margin: 0 50px;
  }
}
</style>
